<%@ Reference Control="~/Controls/PagingControl.ascx" %>
<%@ Register tagprefix="Pager" Tagname="DataGridPager" Src="Controls/PagingControl.ascx" %>
<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.browse" CodeFile="browse.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<form id="Form1" method="post" runat="server">
	<table height="100%" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
		<tr>
			<td class="page_title" colspan="3"><asp:literal id="litTitle" runat=server>Browse</asp:literal></td>
		</tr>
		<tr>
			<td class="main_table_border" vAlign="top" width="240" height="100%">
				<div class="content">
					<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="main_text">
						<tr>
							<td><b><asp:Label id="lblShow" runat=server>Show:</asp:label></b><br />
								<font class="radio_text">
									<asp:checkbox id="chkOnlyPeople" runat="server"></asp:checkbox><asp:label id="lblOnlyPeoplePhotos" runat=server>Only people with photos</asp:label></font>
								<br />
								<asp:radiobutton id="rbJustPhotos" runat="server" value="1" GroupName="grpPhoto"></asp:radiobutton><font class="radio_text"><asp:label id="lblJustPhotos" runat=server>Just photos</asp:label></font>
								<br />
								<asp:radiobutton id="rbPhotosAndInfo" runat="server" value="2" GroupName="grpPhoto"></asp:radiobutton><font class="radio_text"><asp:label id="lblPhotosInfo" runat=server>Photos &amp; Info</asp:label></font>
								<br />
								<br />
								<b><asp:Label id="lblPeopleWhoAre" runat=server>People who are:</asp:label></b>
								<br />
								<asp:radiobutton id="rbAll" runat="server" value="-1" GroupName="grpGender" Checked="True" CssClass="radio_text"></asp:radiobutton><font class="radio_text"><asp:Label id="lblRbTextAll" runat=server>All</asp:label></font>
								<br />
								<asp:radiobutton id="rbMen" runat="server" value="1" GroupName="grpGender"></asp:radiobutton><font class="radio_text"><asp:label id="lblRbTextMen" runat=server>Men</asp:label></font><br />
								<asp:radiobutton id="rbWomen" runat="server" value="2" GroupName="grpGender"></asp:radiobutton><font class="radio_text"><asp:label id="lblRbTextWomen" runat=server>Women</asp:label></font>
								<br />
								<br />
							</td>
						</tr>
						<tr>
							<td noWrap height="133"><b><asp:label id="lblInterestedText" runat=server>Interested In Meeting People for:</asp:label></b>
								<br /><br />
								<img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br /><br />
								<asp:checkbox id="chkMeetPeopleAll" onclick="checkAllMeetingPeopleFor()" runat="server"></asp:checkbox><font class="radio_text"><asp:Label id="lblRbtextAll2" runat=server>All</asp:label></font><br />
								<asp:checkbox id="chkMeetPeopleDating" onclick="uncheckAllCheckbox('_ctl0_chkMeetPeopleAll')"
									runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblRbTextDating" runat=server>Dating</asp:label></font><br />
								<asp:checkbox id="chkMeetPeopleSR" onclick="uncheckAllCheckbox('_ctl0_chkMeetPeopleAll')" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblRbTextSR" runat=server>Serious Relationship</asp:label></font><br />
								<asp:checkbox id="chkMeetPeopleFriends" onclick="uncheckAllCheckbox('_ctl0_chkMeetPeopleAll')"
									runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblRbTextFriends" runat=server>Friends</asp:label></font><br />
								<asp:checkbox id="chkMeetPeopleAP" onclick="uncheckAllCheckbox('_ctl0_chkMeetPeopleAll')" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblRbTextAP" runat=server>Activity Partners</asp:label></font><br />
								<asp:checkbox id="chkMeetPeoplePenpals" onclick="uncheckAllCheckbox('_ctl0_chkMeetPeopleAll')"
									runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblRbTextPenpals" runat=server>Penpals</asp:label></font><br />
								<asp:checkbox id="chkMeetPeopleHangingOut" onclick="uncheckAllCheckbox('_ctl0_chkMeetPeopleAll')"
									runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblRbTextJHO" runat=server>Just hanging out</asp:label></font><br />
								<br /><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br /><br />
							</td>
						</tr>
						<tr>
							<td><b><asp:label id="lblCriteriaAge" runat=server>Age:</asp:label></b>
								<asp:dropdownlist id=ddlminAge runat="server" CssClass="date_field" DataSource="<%# Page %>">
								</asp:dropdownlist>&nbsp;<asp:label id="lblTo" runat=server>to</asp:label>&nbsp;
								<asp:dropdownlist id=ddlmaxAge runat="server" CssClass="date_field" DataSource="<%# Page %>">
								</asp:dropdownlist><br />
								<br />
								<b><asp:label id="lblCriteriaCountry" runat=server>Country:</asp:label></b>
								<asp:dropdownlist id=ddlCountry runat="server" CssClass="date_field" DataSource="<%# Page %>" Width="150px">
								</asp:dropdownlist><br />
								<br />
								<b><asp:label id="lblCriteriaTown" runat=server>City/Town:</asp:label></b>&nbsp;
								<asp:textbox id="txtCity" runat="server" CssClass="mail_field" Width="130px"></asp:textbox><br />
								<br />
								<b><asp:label id="lblCriteriaStatus" runat=server>Status:</asp:label></b>
								<br />
								<asp:checkbox id="chkStatusAny" onclick="checkAllStatus()" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusAny" runat=server>Any</asp:label></font><br />
								<asp:checkbox id="chkStatusSingle" onclick="uncheckAllCheckbox('_ctl0_chkStatusAny')" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusSingle" runat=server>Single</asp:label></font>
								<br />
								<asp:checkbox id="chkStatusInRelationship" onclick="uncheckAllCheckbox('_ctl0_chkStatusAny')"
									runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusInRel" runat=server>In a Relationship</asp:label></font>
								<br />
								<asp:checkbox id="chkStatusOpenRelationship" onclick="uncheckAllCheckbox('_ctl0_chkStatusAny')"
									runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusOpenRel" runat=server>Open Relationship</asp:label></font>
								<br />
								<asp:checkbox id="chkStatusMarried" onclick="uncheckAllCheckbox('_ctl0_chkStatusAny')" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusMarried" runat=server>Married</asp:label></font>
								<br />
								<asp:checkbox id="chkStatusOpenMerriage" onclick="uncheckAllCheckbox('_ctl0_chkStatusAny')" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusOpMar" runat=server>Open Marriage</asp:label></font>
								<br />
								<asp:checkbox id="chkStatusUnknown" onclick="uncheckAllCheckbox('_ctl0_chkStatusAny')" runat="server"></asp:checkbox><font class="radio_text"><asp:label id="lblStatusUnknown" runat=server>Unknown status</asp:label></font>
								<br /><br /><img src="images/spacer.gif" width="100%" height="1" class="spacer_color"><br /><br />
								<b><asp:label id="lblListResultsText" runat=server>List results by:</asp:label></b>
								<br />
								<asp:radiobutton id="rbListByRecentlyUpdated" runat="server" value="1" groupname="grpListBy" checked="True" cssclass="radio_text"></asp:radiobutton><font class="radio_text"><asp:label id="lblResultsRecntlyUpdated" runat=server>Recently updated</asp:label></font><br />
								<asp:radiobutton id="rbListByLastLogin" runat="server" value="2" groupname="grpListBy"></asp:radiobutton><font class="radio_text"><asp:label id="lblResultsLastLogin" runat=server>Last log in</asp:label></font><br />
								<asp:radiobutton id="rbListByNewest" runat="server" value="3" groupname="grpListBy"></asp:radiobutton><font class="radio_text"><asp:label id="lblResultsNew" runat=server>New to 2Bmates</asp:label></font>
								<br /><br />
								<img src="images/spacer.gif" width="100%" height="1" class="spacer_color">
								<br /><br />
								<asp:button id="btnSearch" runat="server" CssClass="btn" CausesValidation="False" Text="Browse"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnSearch_Click"></asp:button><br /><br />
							</td>
						</tr>
					</table>
				</div>
			</td>
			<td class="small" width="10">&nbsp;</td>
			<td vAlign="top" width="519" height="100%" class="main_table_border">
				<div class="content">
					<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="main_text">
						<tr>
							<td class="title_in"><asp:literal id="litResultsTitle" runat=server>Browse&nbsp;Results</asp:literal></td>
						</tr>
						<!-- Begin search results -->
						<tr>
							<td vAlign="top" align="left"><%=searchCriteria%><br />
								<asp:label id="lblNoResults" runat="server" CssClass="main_text" Visible="False" Font-Bold="True">No results found.<br /></asp:label>
								<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="main_text">
									<tr>
										<td vAlign="top"><PAGER:DATAGRIDPAGER id="dgPagerUp" runat="server"></PAGER:DATAGRIDPAGER></td>
									</tr>
									<tr>
										<td class="small" height="3">&nbsp;</td>
									</tr>
									<tr>
										<td vAlign="top" align="left"><ASP:DATAGRID id="dgResults" runat="server" CssClass="search_results_table" Width="100%" AllowSorting="True"
												CellPadding="0" PagerStyle-HorizontalAlign="Right" PagerStyle-Mode="NumericPages" AllowCustomPaging="True" AllowPaging="True"
												GridLines="None" AutoGenerateColumns="False">
												<itemstyle cssclass="data_grid" verticalalign="Top"></ItemStyle>
												<headerstyle cssclass="search_results_header"></HeaderStyle>
												<columns>
													<asp:TemplateColumn HeaderText="User">
														<headerstyle height="20px" width="20%" cssclass="search_results_header"></HeaderStyle>
														<itemstyle cssclass="search_results_img" horizontalalign=center></itemstyle>
														<itemtemplate>
															<asp:hyperlink id=hlUser runat="server" class="main_text_bold" navigateurl='<%# DataBinder.Eval(Container.DataItem, "URL") %>'>
																<%# DataBinder.Eval(Container.DataItem, "Name") %>
															</asp:hyperlink>
															<br />
															<asp:hyperlink id=hlUserImage runat="server" CssClass="small_image" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "UserImg") %>' NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "URL") %>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "NameFull") %>'></asp:hyperlink>
															<img src="images/spacer.gif" height="3" width="1"><br />
															<asp:image id="Image1" runat="server" imageurl='<%# DataBinder.Eval(Container.DataItem, "OnlineImg") %>' >
															</asp:image>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="Personal Info">
														<headerstyle width="51%" cssclass="search_results_header"></HeaderStyle>
														<itemstyle cssclass="search_results_info"></itemstyle>
														<itemtemplate>
															<asp:label id="lblName" runat="server" Font-Bold="True">
																<%# DataBinder.Eval(Container.DataItem, "NameFull") %>
															</asp:label>
															<br />
															<br />
															<asp:label id="Label1" runat="server" Font-Bold="True">Gender:</asp:label>
															<asp:label id="lblGender" runat="server">
																<%# DataBinder.Eval(Container.DataItem, "Gender") %>
															</asp:label>
															<br />
															<asp:label id="Label2" runat="server" Font-Bold="True">Status:</asp:label>
															<asp:label id="lblStatus" runat="server">
																<%# DataBinder.Eval(Container.DataItem, "MStatus") %>
															</asp:label>
															<br />
															<asp:label id="lblAge" runat="server" Font-Bold="True">Age:</asp:label>
															<asp:label id="lblAgeValue" runat="server">
																<%# DataBinder.Eval(Container.DataItem, "Age") %>
															</asp:label>
															<br />
															<asp:label id="lblLocation" runat="server" Font-Bold="True">Location:</asp:label>
															<asp:label id="lblLocationValue" runat="server">
																<%# DataBinder.Eval(Container.DataItem, "Location") %>
															</asp:label>
															<br />
															<br />
															<asp:label id="Label4" runat="server">
																<b>Interested in Meeting People for:</b></asp:label>
															<br />
															<asp:label id="lblMeetPeopleFor" runat="server">
																<%# DataBinder.Eval(Container.DataItem, "MeetPeopleFor") %>
															</asp:label>
															<br />
															<br />
															<asp:label id="lblProfileUpdated" runat="server" Font-Bold="True">Profile Updated: </asp:label>
															<asp:label id="lblProfileUpdatedValue" runat="server">
																<%# DataBinder.Eval(Container.DataItem, "ProfileUpdated") %>
															</asp:label>
															<br />
															<br />
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="Actions">
														<headerstyle width="29%" cssclass="search_results_header"></HeaderStyle>
														<itemstyle cssclass="user_links"></ItemStyle>
														<itemtemplate><asp:hyperlink id=hlAddToFriends class="main_text_bold" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "AddToFriendsLink") %>'>Add to Friends</asp:hyperlink>
															<br />
															<asp:hyperlink id=hlAddToFav class="main_text_bold" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "AddToFavLink") %>'>Add to Favourites</asp:hyperlink>
															<br />
															<asp:hyperlink id=hlSendMessage class="main_text_bold" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "SendMessageLink") %>'>Send a Message</asp:hyperlink>
															<br />
															<asp:hyperlink id=hlForwardToFriend class="main_text_bold" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ForwardToFriendLink") %>'>Forward to a Friend</asp:hyperlink>
															<br />
															<asp:hyperlink id=hlBlockUser class="main_text_bold" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "BlockUserLink") %>'>Block User</asp:hyperlink>
														</ItemTemplate>
													</asp:TemplateColumn>
												</Columns>
												<pagerstyle verticalalign="Top" visible="False" horizontalalign="Right" mode="NumericPages"></PagerStyle>
											</ASP:DATAGRID>
											<!-- begin datalist - only pictures --><asp:datalist id="dlResults" runat="server" CssClass="data_list" Width="100%" CellPadding="0"
												RepeatDirection="Horizontal" HorizontalAlign="Left" ShowHeader="False" BorderWidth="0px" ShowFooter="False" repeatcolumns="5">
													<itemstyle horizontalalign="Left" width="20%" verticalalign="Top"></ItemStyle>
													<itemtemplate>
														<table cellspacing=0 cellpadding=0 border=0 class="main_text">
															<tr>
																<td class="small" height="3">&nbsp;</td>
															</tr>
															<tr>
																<td valign=top align=center height=100><asp:linkbutton id=lbName runat="server" text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' commandargument='<%# DataBinder.Eval(Container.DataItem, "UserID") %>' commandname="MemberRedirect" cssclass="main_text_bold"></asp:linkbutton><br /><asp:hyperlink id=hlPhoto runat="server" CssClass="small_image" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "UserID") %>' CommandName="MemberRedirect" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "MemberURL") %>' ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImageURL") %>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "FullName") %>'></asp:hyperlink><br /><img height=3 src="images/spacer.gif" width=1><br /><asp:image id=imgOnline align="center" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "OnlineImg") %>'></asp:image></td>
															</tr>
															<tr>
																<td class="small" height="3">&nbsp;</td>
															</tr>
														</table>
													</ItemTemplate>
											</asp:datalist><asp:textbox id="txtStartIndexHidden" style="DISPLAY: none" runat="server" Width="1px"
												Height="1px">0</asp:textbox><asp:textbox id="txtFriendsCountHidden" style="DISPLAY: none" runat="server" Width="1px"
												Height="1px">0</asp:textbox>
											<!-- end datalist - only pictures --></td>
									</tr>
									<tr>
										<td class="small" height="3">&nbsp;</td>
									</tr>
									<tr>
										<td vAlign="top"><PAGER:DATAGRIDPAGER id="dgPager" runat="server"></PAGER:DATAGRIDPAGER></td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
					<!-- End search results --></table>
			</td>
		</tr>
	</table>
</form>
<script language="javascript">
	// check / uncheck Meet people for options
	function checkAllMeetingPeopleFor(){
		var bCheck = document.forms[0]['_ctl0_chkMeetPeopleAll'].checked;

		document.forms[0]['_ctl0_chkMeetPeopleDating'].checked = bCheck;
		document.forms[0]['_ctl0_chkMeetPeopleSR'].checked = bCheck;
		document.forms[0]['_ctl0_chkMeetPeopleFriends'].checked = bCheck;
		document.forms[0]['_ctl0_chkMeetPeopleAP'].checked = bCheck;
		document.forms[0]['_ctl0_chkMeetPeoplePenpals'].checked = bCheck;
		document.forms[0]['_ctl0_chkMeetPeopleHangingOut'].checked = bCheck;
	}
	// check / uncheck Status Any
	function checkAllStatus(){
		var bCheck = document.forms[0]['_ctl0_chkStatusAny'].checked;

		document.forms[0]['_ctl0_chkStatusSingle'].checked = bCheck;
		document.forms[0]['_ctl0_chkStatusInRelationship'].checked = bCheck;
		document.forms[0]['_ctl0_chkStatusOpenRelationship'].checked = bCheck;
		document.forms[0]['_ctl0_chkStatusMarried'].checked = bCheck;
		document.forms[0]['_ctl0_chkStatusOpenMerriage'].checked = bCheck;
		document.forms[0]['_ctl0_chkStatusUnknown'].checked = bCheck;
	}	
	function uncheckAllCheckbox(chkName){
		document.forms[0][chkName].checked = false;
	}	
</script>

